Skip to content

feat: add CZK to the preferred currency picker - #2886

Merged
steipete merged 1 commit into
steipete:mainfrom
vAhyThe:feat/czk-preferred-currency
Aug 13, 2026
Merged

feat: add CZK to the preferred currency picker#2886
steipete merged 1 commit into
steipete:mainfrom
vAhyThe:feat/czk-preferred-currency

Conversation

@vAhyThe

@vAhyThe vAhyThe commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds CZK (Kč) to the preferred currency picker in Settings → General, following the exact shape of #2669 (KRW) on top of the list introduced in #2490 (refs #2449). Koruna-billed users currently convert the USD estimates by hand to compare against a card statement.

Change

Three lines of source, no new exchange-rate logic:

  • CurrencyExchange.swift"CZK" joins supportedCurrencies, placed with the European currencies (after EUR) rather than appended, matching the existing regional grouping.
  • CurrencyExchange.swift"CZK": 21.0 joins the hardcoded fallback table. Existing fallback values are untouched.
  • PreferencesGeneralPane.swiftPreferredCurrencyOption.czk and its "CZK (Kč)" label.

fetchLatestRatesIfNeeded already merges every rate in the open.er-api.com/v6/latest/USD payload, and that payload carries CZK. Listing the code in supportedCurrencies is what opens the requiresLiveRates gate, so selecting CZK triggers the same live-fetch and 24h-cache path as the existing currencies; the hardcoded rate is only read before the first successful fetch.

No public API surface change: supportedCurrencies gains an element, its signature is unchanged.

Formatting

CZK is a two-decimal currency and UsageFormatter.currencyString pins Locale(identifier: "en_US"), where ICU has no symbol — amounts render as CZK 210.11. That is consistent with how other non-Latin-symbol currencies degrade under the pinned locale, and host-locale independence is preserved. (The in the picker label is just the label, mirroring how "TWD (NT$)" names its local symbol.)

Validation

  • swift test --filter UsageFormatter — passes, including the new assertions

New coverage in UsageFormatterTests.swift, mirroring the KRW assertions:

  • USD → CZK conversion equals the table rate (convert(usdAmount:to:))
  • CZK code is rendered with two fraction digits
  • requiresLiveRates("CZK") == true, so the live fetch actually triggers rather than the currency silently sitting on the hardcoded rate

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 6:27 AM ET / 10:27 UTC.

ClawSweeper review

What this changes

The PR adds Czech koruna (CZK) to the preferred-currency picker, offline rate table, and formatter coverage.

Merge readiness

Blocked until real behavior proof is added - 3 items remain

The patch correctly follows the established preferred-currency design, but this external UI PR needs after-fix fresh-bundle proof before merge.

Priority: P3
Reviewed head: 8ba8704fa0738989c1f5bdeb001f39654d6aecca

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and consistent with the shipped currency design, but required real-behavior proof is absent.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR reports focused tests but provides no after-fix fresh-bundle evidence showing CZK selected and rendered; add redacted UI or terminal proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports focused tests but provides no after-fix fresh-bundle evidence showing CZK selected and rendered; add redacted UI or terminal proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Picker and refresh path: Current main builds the picker from all preferred-currency cases and triggers the existing live-rate refresh when a supported non-USD selection changes.
Branch uses all established integration points: The branch adds CZK to the picker enum, supported currency list, and fallback-rate table without changing conversion behavior.
Focused coverage: The branch verifies conversion availability, two-decimal CZK rendering, and the live-rate eligibility gate.
Findings None None.
Security None None.

How this fits together

CodexBar converts provider cost estimates to a user-selected display currency. Settings supplies the chosen code, CurrencyExchange obtains a cached live or fallback rate, and UsageFormatter renders the converted amount in menu surfaces.

flowchart LR
    A[Provider cost estimate] --> B[Preferred currency setting]
    B --> C[Currency conversion]
    D[Cached live or fallback rates] --> C
    C --> E[Cost formatter]
    E --> F[Menu and settings display]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports focused tests but provides no after-fix fresh-bundle evidence showing CZK selected and rendered; add redacted UI or terminal proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - No after-fix fresh-bundle evidence demonstrates that CZK can be selected in Settings and that a converted amount appears in the running app.
  • Complete next step (P2) - The remaining merge blocker is contributor-supplied runtime proof, not a concrete repair suitable for an automated fix branch.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Diff scope 3 files; production +4/-1, tests +7 The narrowly scoped data/UI addition is covered by focused formatter and live-rate-gate assertions.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing list-driven currency design and merge after a redacted fresh-app proof shows both the CZK selection and converted output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing list-driven currency design and merge after a redacted fresh-app proof shows both the CZK selection and converted output.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a new picker option rather than a report of broken behavior; the branch's runtime result still needs direct app proof.

Is this the best way to solve the issue?

Yes: extending the established picker, supported-code list, fallback rates, and formatter checks is the narrowest maintainable implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a90dfed5c264.

Labels

Label changes:

  • add P3: This is a small enhancement to an existing preferred-currency feature with limited blast radius.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests but provides no after-fix fresh-bundle evidence showing CZK selected and rendered; add redacted UI or terminal proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a small enhancement to an existing preferred-currency feature with limited blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests but provides no after-fix fresh-bundle evidence showing CZK selected and rendered; add redacted UI or terminal proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Yuxin-Qiao: The merged multi-currency implementation established the converter and preferred-currency path this patch extends. (role: introduced currency-conversion feature; confidence: high; commits: 35626eb1cf5e; files: Sources/CodexBarCore/CurrencyExchange.swift, Sources/CodexBar/PreferencesGeneralPane.swift)
  • kes02: Added the closely analogous KRW picker option using the same currency list and formatter-test surfaces. (role: adjacent feature contributor; confidence: high; commits: aa7c2b51ab69; files: Sources/CodexBarCore/CurrencyExchange.swift, Sources/CodexBar/PreferencesGeneralPane.swift, Tests/CodexBarTests/UsageFormatterTests.swift)
  • steipete: Merged the original currency feature and owns the current main branch revision examined for this review. (role: feature merger and recent repository contributor; confidence: medium; commits: 35626eb1cf5e, a90dfed5c264; files: Sources/CodexBarCore/CurrencyExchange.swift, Sources/CodexBar/PreferencesGeneralPane.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted proof from a freshly built bundle showing CZK selected in Settings and a converted cost rendered in the app.
  • Update the PR body with the proof; if no fresh review arrives, ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1f5bdb8 into steipete:main Aug 13, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants